<template>
	<view class="">
		<view class="cu-timeline" v-for="(item,index) in list" :key="index">
			<view class="cu-time">{{item.date}}</view>
			<view class="cu-item">
				<view class="content">
					<text>{{item.time}}</text> {{item.txt}}
				</view>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				none: "",
				pageIndex: 1,
			}
		},
		onReachBottom() {
			// this.adUnitIdbanner = this.advertisingData1(this.advertisingDataType.bannerList)
			if (this.none) {
				return
			}
			++this.pageIndex
			this.getList()
		},
		onLoad() {
		this.getList()
		},
		methods: {
			async getList() {
				var userInfo = uni.getStorageSync('user') || {}
				var data = await this.$api.getData({
					dbName: "wx_inform",
					sortRule: [
						{
							"name": "_add_time",
							"type": "desc"
						}
					],
					whereJson: {
						status: 1
					},
					pageIndex: this.pageIndex,
					pageSize: 10
				})

				if (data.rows.length != 0) {
					var list = data.rows.filter(item => {
						item.date = this.$T.dateFormat(new Date(item._add_time),'{Y}-{MM}-{DD}')
						item.time = this.$T.dateFormat(new Date(item._add_time),'{hh}:{tt}:{ii}:{ss}')
						return item.site == 3 || item.site == 2
					})
					this.list = [...this.list, ...list]
					
					console.log(this.list,'1212')
					
				} else {
					this.none = '没有数据了'
				}
			},
		}
	}
</script>

<style>
	page {
		background: #fff;
	}
</style>
